<template>
  <div class="note">
    <el-input
      type="textarea"
      :autosize="{ minRows: 3, maxRows: 6 }"
      placeholder="请输入内容"
      v-model="info.remark"
    ></el-input>
    <div class="after-box">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="save" :loading="saveLoading">确 定</el-button>
    </div>
  </div>
</template>
<script>
  export default {
    props: ['info'],
    data() {
      return {
        // 保存loading
        saveLoading: false,
      };
    },
    methods: {
      // 关闭
      close() {
        this.$emit('dialogCancel');
      },
      // 保存
      save() {
        this.saveLoading = true;
        this.$service.MallOrderRemark({ id: this.info.id, content: this.info.remark }).then((res) => {
          this.saveLoading = true;
          this.$emit('dialogSubmit');
          this.$message.success('保存成功！');
        });
      },
    },
  };
</script>
<style lang="less" scoped>
  .note {
    .after-box {
      text-align: right;
      margin-top: 20px;
    }
  }
</style>
